><

About percentage units



The format of a percentage value is an optional plus or minus sign (+ is the default), immediately followed by a number (with or without a decimal point), immediately followed by the percent sign (%).

Percentage values are always relative to another value--for example, a length unit. Each property that allows percentage units also defines what value the percentage value refers to. Most often this is the font size of the element itself, such as line height.

Many style properties use keywords instead of numerical unit specifications--for example, XX-small through X-large to specify font size relative to the parent element.


Using Cascading Style Sheets > About cascading style sheets > About percentage units